package com.songlanyun.modules.servicegoods.controller.api;

import com.songlanyun.common.utils.R;
import com.songlanyun.common.validator.ValidatorUtils;
import com.songlanyun.modules.account.controller.common.AbstractApiController;
import com.songlanyun.modules.servicegoods.entity.ServiceGoodsGroup;
import com.songlanyun.modules.servicegoods.model.dto.ServiceGoodsGroupDTO;
import com.songlanyun.modules.servicegoods.service.ServiceGoodsGroupService;
import com.songlanyun.modules.user.controller.AbstractController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;


/**
 * 商家的服务分组，只用来在商家店铺内展示
 *
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2020-12-15 11:51:34
 */
@RestController
@RequestMapping("api/servicegoods/group")
public class ServiceGoodsGroupApiController extends AbstractApiController {
    @Autowired
    private ServiceGoodsGroupService serviceGoodsGroupService;

    /**
     * 所有商家的服务分组
     */
    @RequestMapping("/all/{shopId}")
    //@RequiresPermissions("shop:goods_group:all")
    public R all(@PathVariable("shopId") Long shopId){
        List<Map<String, Object>> objs = serviceGoodsGroupService.getAllGoodsGroup(shopId);
        return R.ok().put("list", objs);
    }




}
